package com.databasedesign.dao;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.databasedesign.pojo.po.Dormitory;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface DormitoryDao extends BaseMapper<Dormitory> {
    @Select("select * from dormitory")
     List<Dormitory> GetAll();

    @Select("SELECT * FROM `dormitory` where room_number like '1-%' or room_number like  '2-%'")
    List<Dormitory> GetGirl();

    @Select("SELECT * FROM `dormitory` where room_number like '13-%'")
    List<Dormitory> GetBoy();

    @Select("SELECT dormitory_id FROM `dormitory` where room_number = #{RoomNumber}")
    Integer GetIdByRoomNumber(String RoomNumber);
    @Select("SELECT Room_number FROM `dormitory` where dormitory_id = #{DormitoryId}")
    String GetRoomNumberById(Integer DormitoryId);
}
